import * as func from "./func.js"
import HighModal from "@/components/HighModal/index.vue"
export default {
  name: '',
  props: {
    isShow: {
      type: Boolean,
      default: false,
    },
    operateForm: { // 随访表单
      type: Array,
      default: () => [],
    },
  },
  components:{
    HighModal
  },
  data(){
    return {
      formHtml:''
    }
  },
  methods:{
    ...func,
  },
  watch:{
    operateForm: {
      handler(newVal, oldVal){
        this.formHtml = this.operateForm.length ? this.syntaxHighlight(JSON.stringify(newVal, null, 2)) : ''
      },
      deep: true,
      immediate: true,
    }
  },
  async created(){
    await _.loadCss(`${window.location.protocol}//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/default.min.css`)
    await _.loadJs(`${window.location.protocol}//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js`)
    hljs.initHighlightingOnLoad()
  },
  mounted(){
    
  },
}